#if !defined(AFX_REMINDERDIALOG_H__4F323F62_35AA_422D_8C15_29805310E090__INCLUDED_)
#define AFX_REMINDERDIALOG_H__4F323F62_35AA_422D_8C15_29805310E090__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ReminderDialog.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CReminderDialog dialog

#include "resource.h"
#include "..\IniFile.h"	// Added by ClassView
#include "RemEditDialog.h"

#define KEY_REM "REM"
#define TYPE_MAX 20
#define TYPE_NOTFOUND -1;


#define LISTSORT_DATE		1
#define LISTSORT_TYPE		2
#define LISTSORT_DESCR		3 

class CReminderDialog : public CDialog
{
// Construction
public:
	void FillINI();
	void DeleteREMKeys();
	void FillTypeArh();
	class CRemTypeArh
	{	public:
		CString D[TYPE_MAX];
		int C[TYPE_MAX];
		void Clear() 
		{	for(int i=0;i<TYPE_MAX;i++)
			{	D[i]="";
				C[i]=0;
			}
		};
		CRemTypeArh() {};
		void	Add(CString Descr,int Cycle,DWORD N)
		{	ASSERT(N<TYPE_MAX);
			D[N]=Descr;
			C[N]=Cycle;
		};
		int GetNum(CString Descr)
		{	for(int i=0;i<TYPE_MAX;i++)	if (D[i]==Descr) return i;
			return TYPE_NOTFOUND;
		};
		CString GetDescr(DWORD N)
		{	ASSERT(N<TYPE_MAX);
			return D[N];
		};
		int GetCycle(DWORD N)
		{	ASSERT(N<TYPE_MAX);
			return C[N];
		};
	};
	CRemTypeArh m_typeArh;
	void AddListItem(CString Date,CString Type,CString Text);
	void EnableButtons(BOOL F);
	void SortList();
	void FillList();
	void INI_Save();
	CString m_FileName;
	void INI_Load();
	
	CIniFile m_ini;
	CString m_AppPath;
	int m_deldays;
	BOOL m_isChanged;
	int m_listSortType;
	CReminderDialog(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CReminderDialog)
	enum { IDD = IDD_DIALOG_REMINDER };
	CListCtrl	m_list;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CReminderDialog)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	CString LoadString(UINT id);
	// Generated message map functions
	//{{AFX_MSG(CReminderDialog)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnButtonEdit();
	afx_msg void OnButtonAdd();
	afx_msg void OnButtonDel();
	afx_msg void OnClickList(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnColumnclickList(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_REMINDERDIALOG_H__4F323F62_35AA_422D_8C15_29805310E090__INCLUDED_)
